<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBooksInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('books_info', function(Blueprint $table)
        {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->string('name')->nullable()->comment('读物名称');
            $table->text('desc')->nullable()->comment('读物简介');
            $table->integer('img_id')->default(0)->comment('图片id');
            $table->integer('total_word_num')->default(0)->comment('读物字数');
            $table->tinyInteger('is_complete')->default(0)->comment('读物是否完结 0：连载中 1：完结');
            $table->string('type')->nullable()->comment('读物类型 word 文字 audio 音频');
            $table->tinyInteger('home_show')->default(0)->comment('是否推荐 0：不推荐 1：推荐');
            $table->tinyInteger('status')->default(0)->comment('状态 0：下架 1：上架');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
